{__NOLAYOUT__}
<form action="{:url('Lease/agree')}" class="layui-form " method="post" style="margin: 20px">

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label" style="width: 100px">是否需要驾驶员</label>
            <span class="radio" val="1"><input type="radio" name="is_need" value="1" title="需要" ></span>
            <span class="radio" val="2"><input type="radio" name="is_need" value="2" title="不需要" checked></span>
        </div>
    </div>

    <input type="hidden" name="id" class="id" value="{$id}">

    <div class="layui-form-item drive" style="display: none">
        <label class="layui-form-label">选择驾驶员</label>
        <div class="layui-input-inline">
            <select name="drive_id">
                <option value="">驾驶员名称</option>
                {volist name="drive" id="d"}
                <option value="{$d.drive_id}">{$d.drive_name}</option>
                {/volist}
            </select>
        </div>
    </div>

    <div class="layui-form-item" style="text-align: center">
        <button class="layui-btn" lay-submit="" lay-filter="ajax">提交</button>
    </div>
</form>


<script>
    //Demo
    layui.use('form', function () {
        var form = layui.form;
        form.render(); //更新全部
    });
</script>


<script>
    $(".radio").click(function(){
        var val = $(this).attr("val");
        if(val == 1){
            $(".drive").css('display', 'block');
        } else {
            $(".drive").css('display', 'none');
        }
    });
</script>